Merge pull request #506 from andrewcsmith/patch-2
[supercollider.git] / platform / mac / Standalone Resources / SCClassLibrary / modifyStartup.sc
blob25dcec6bcc730339f4316524c58626a25134ae90
1 + OSXPlatform {
3         startupFiles {
4 //              var filename = "startup.rtf";
5 //              ^[this.systemAppSupportDir +/+ filename, this.userAppSupportDir +/+ filename];
6                         // look for startup files inside the app Contents directory
7                 var filename = "startup.*";
8                 ^(String.scDir +/+ filename).pathMatch;
9         }
11         startup {
12                 Document.implementationClass.startup;
13                 // make a server window for the internal if you like
14                 Server.internal.makeWindow;
15 //              Server.local.makeWindow;
16                 // uncomment if you use a startup file
17 //              this.loadStartupFiles;
18                 // uncomment if you have multiple help files
19 //              Help.addToMenu;
20         }
23 + Main {
24         startup {
25                 platform = this.platformClass.new;
26                 platform.initPlatform;
28                 super.startup;
30                 GUI.fromID( this.platform.defaultGUIScheme );
31                 GeneralHID.fromID( this.platform.defaultHIDScheme );
33                 // Set Server.default and the 's' interpreter variable to the internal server.
34                 // You should use the internal server for standalone applications --
35                 // otherwise, if your application has a problem, the user will
36                 // be stuck with a process, possibly making sound, that he won't know
37                 // how to kill.
38                 Server.default = Server.internal;
39                 interpreter.s = Server.default;
41                         // some folder paths that should point inside the app's Contents folder
42                 SynthDef.synthDefDir = String.scDir +/+ "synthdefs/";
43                 Archive.archiveDir = String.scDir;
45                 this.platform.startup;
47                 // from here on, you should customize what should happen...
49                 StartUp.run;
51                 // One can boot the server, then use .load to evaluate a file
52                 // OR - put things into a class... like the SCSA_Demo
54                 "Welcome to Standalone Demo made with SuperCollider, type cmd-d for help.".postln;
56                 Server.default.boot;
58                 Server.default.waitForBoot({
59                         SCSA_Demo.new("The Cheese Stands Alone", Rect(400, 400, 300, 200), interpreter.s).front;
60 //                      (String.scDir.dirname ++ "/MFBSD.rtf").load;
61                 });
62                 // close post window if user should not have it
63 //              Document.listener.close
64         }